package com.boang.set;

import java.util.HashSet;

/*
  @author: 13813
  @date: 2024/11/29 11:16
*/
public class HashSetDemo {
    public static void main(String[] args) {
        m1();
//        m2();
    }

    private static void m2() {
        HashSet<String> set = new HashSet<>();
//        Student zhangsan = new Student("zhangsan", 20);
        set.add("zhangsan");
        set.add("lisi");
        set.add("lisi");

        System.out.println(set);
    }

    private static void m1() {
        HashSet<Student> set = new HashSet<>();
//        Student zhangsan = new Student("zhangsan", 20);
        set.add(new Student("zhangsan", 20));
        set.add(new Student("lisi", 30));
        set.add(new Student("lisi", 30));

        System.out.println(set);
    }
}
